package org.openea.eap.module.obpm.model.form;

import lombok.Data;
import org.openbpm.base.api.model.IDModel;
import org.openbpm.base.core.util.AppUtil;
import org.openbpm.base.core.util.StringUtil;
import org.openea.eap.module.obpm.service.form.FormCustDialogManager;


@Data
public class FormCombinateDialog
  implements IDModel
{
  protected String id;
  protected String name;
  protected String alias;
  protected Integer width;
  protected Integer height;
  protected String treeDialogId;
  protected String treeDialogName;
  protected String listDialogId;
  protected String listDialogName;
  protected String field;
  private FormCustDialog treeDialog;
  private FormCustDialog listDialog;

  public FormCustDialog getTreeDialog() {
    if (StringUtil.isEmpty(this.treeDialogId)) {
      return null;
    }
    this.treeDialog = (FormCustDialog)((FormCustDialogManager)AppUtil.getBean(FormCustDialogManager.class)).get(this.treeDialogId);
    return this.treeDialog;
  }

  public FormCustDialog getListDialog() {
    if (StringUtil.isEmpty(this.listDialogId)) {
      return null;
    }
    this.listDialog = (FormCustDialog)((FormCustDialogManager)AppUtil.getBean(FormCustDialogManager.class)).get(this.listDialogId);
    return this.listDialog;
  }
}
